package studiodiva.portfolio.client.view;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Widget;

import static studiodiva.portfolio.client.lib.lang.Lang.doLater;

import studiodiva.portfolio.client.lib.lang.Run;
import studiodiva.portfolio.client.lib.view.Layout;
import studiodiva.portfolio.client.lib.view.View;
import studiodiva.portfolio.client.view.particleengine.MouseParticles;

public class AnimationPanel extends View<Widget> {

  interface Binder extends UiBinder<Widget, AnimationPanel> {}

  // private static SocialButtonsBundle bundle = GWT.create(SocialButtonsBundle.class);
  private static Binder uiBinder = GWT.create(Binder.class);

  @UiField
  Widget centerPanel;

  @UiField
  FlowPanel leftPanel;

  @UiField
  FlowPanel rightPanel;

  public AnimationPanel() {
    initWidget(uiBinder.createAndBindUi(this));
    Layout.heightAsParent(centerPanel);
    final MouseParticles left = new MouseParticles();
    left.setSize(200, 130);
    leftPanel.add(left);
    final MouseParticles right = new MouseParticles();
    right.setSize(200, 130);
    rightPanel.add(right);

    doLater(3000, new Run() {
      public void run() {
        left.show();
        right.show();
      }
    });
  }
}
